
$(function() {
	var extras = {"Boolean":{map:{"true":"是","false":"否"},list:[{key:"true",value:"是"},{key:"false",value:"否"}]}};
	$(".x-space").each(function() {
		var space = $(this).panel();
		space.data("x-call", "panel");
		var options = space.xcall("options");
		options.initial = $.extend({}, options.initial, $.getPageParams());
		options.extras = $.extend(extras, options.extras);
		$.zhh.events.trigger(this, options.view, space, options.initial, options.extras);
	});
	
	var uri = window.location.href.replace(/[;?#].*/, "");
	var sidebar = $(document.body).find(".lyt-sidebar .sidebar-menu");
	sidebar.find("a").each(function() {
		var href = $(this).attr("href");
		if (href && uri.endsWith(href.replace(/^[\.#]+(\/[\.#]+)*/, ""))) {
			$(this).parent().addClass("active").parents(".header").addClass("active");
		}
	});
});
